package com.外观模式;

/**
 * 外观类
 */
public class HomeTheatherFacade {

    private DVDPlayer dvdPlayer;

    private Popcorn popcorn;

    private Projecter projecter;

    private Screen screen;

    private Stereo stereo;

    private TheatherLight theatherLight;

    /**
     * 构造器
     */
    public HomeTheatherFacade() {
        this.dvdPlayer = DVDPlayer.getInstance();
        this.popcorn = Popcorn.getInstance();
        this.projecter = Projecter.getInstance();
        this.screen = Screen.getInstance();
        this.stereo = Stereo.getInstance();
        this.theatherLight = TheatherLight.getInstance();
    }

    /**
     * 准备工作
     */
    public void ready(){
        popcorn.on();
        popcorn.off();
        screen.down();
        projecter.on();
        stereo.on();
        dvdPlayer.on();
        theatherLight.dim();
    }

    /**
     * 开始播放
     */
    public void play(){
        dvdPlayer.play();
    }

    /**
     * 暂停
     */
    public void  pause(){
        dvdPlayer.pouse();
    }

    /**
     * 关闭
     */
    public void shutDown(){
        dvdPlayer.off();
    }
}
